Skip to content

Conversation

@gcp
Copy link
Contributor

@gcp gcp commented Dec 26, 2025

Extend the URL opening IPC with a flag indicating where to open things.

@gcp gcp requested a review from a team December 26, 2025 16:30
@gcp gcp force-pushed the right-click-actions branch from 0beecbc to 45fa1e2 Compare December 26, 2025 16:54
Copy link
Contributor

@1rneh 1rneh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, overall the changes on the js side look good!

Two things I noticed:

  • Most of these changes still need some #ifdef MOZ_ENTERPRISE-ing.
  • The code that handles external links and requests new windows is very distributed. I think a new module that centralizes all that logic would help.

export let gFeltPendingURLs = [];
const FELT_OPEN_DISPOSITION_DEFAULT = 0;
const FELT_OPEN_DISPOSITION_NEW_WINDOW = 1;
const FELT_OPEN_DISPOSITION_NEW_PRIVATE_WINDOW = 2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's export these flags here and import them wherever needed (e.g. in browser/base/content/nonbrowser-mac.js and browser/extensions/felt/api.js). Maybe also wrap them in an enum?

export const FELT_OPEN_WINDOW_DISPOSITION = {
  DEFAULT : 0,
  NEW_WINDOW : 1,
  NEW_PRIVATE_WINDOW : 2,
}

// Make sure that when FeltUI is requested, we do not try to open another
// window. Instead, forward any URLs to be opened in the real Firefox.
if (Services.felt.isFeltUI()) {
if (isFeltUI) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we delcare isFeltUI closer to its usage? Or actually, since it's only used once, we could generally drop the variable and call Services.felt.isFeltUI(); directly.

);
queueURL(payload);
} catch (err) {
gFeltPendingURLs.push(payload);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also leave a log message console.warn(`Retrying to queue url ${payload.url} after initial failure.`);

gcp added 3 commits January 23, 2026 12:40
Extend the URL opening IPC with a flag indicating where to open things.
Prevent users from triggering new window/private window actions before
Firefox is ready by implementing platform-native blocking:

- macOS: Grey out dock menu items until ready
- Windows: Block jump list until ready (uses existing blockJumpList mechanism)
- Linux: Show notification when action is queued before ready

Adds felt-firefox-window-ready observer notification that fires when both
firefoxReady and extensionReady are true.
Move the pending URL queue (gFeltPendingURLs), disposition constants
(FELT_OPEN_WINDOW_DISPOSITION), and queueFeltURL function from
BrowserContentHandler.sys.mjs into a dedicated FeltURLHandler.sys.mjs
module. This improves code organization and makes the URL handling
logic more maintainable.

Update all consumers to import from the new module location.
@gcp gcp force-pushed the right-click-actions branch from bc95e58 to 513bfe7 Compare January 23, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants